var xtChangePwdWinAdd;
var xtChangePwdFormAdd;
function addXtChangePwd(){
	initXtChangePwdFormAdd();
	xtChangePwdWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtChangePwdFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtChangePwdFormAdd,'../xtChangePwdController/addXtChangePwd',grid,xtChangePwdWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtChangePwdWinAdd.show();
	/**初始化附件右键菜单开始 参数4为1表示拥有上传和删除功能 即新增和编辑页面使用**/
	initFileRight('xt_attachment_id','xt_attachment_id_pic',1,1);
	/**初始化附件右键菜单结束**/

}
function initXtChangePwdFormAdd(){
	xtChangePwdFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		/**新方法使用开始**/  
        scrollable:true,  
        scrollable:'x',
        scrollable:'y',
        /**新方法使用结束**/
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'用户名称',
			xtype:'textfield',
			name:'user_name',
			maxLength:64,
			anchor:'40%'
		},
		{
			fieldLabel:'登录账号',
			xtype:'textfield',
			name:'login_id',
			maxLength:255,
			anchor:'40%'
		},
		{
			fieldLabel:'性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别',
			xtype:'combo',
			emptyText:'请选择',
			store:xt_change_pwd_sex_combo,
			mode:'local',
			triggerAction:'all',
			editable:false,
			hiddenName:'sex',
			valueField:'value',
			displayField:'text',
			name:'sex',
			maxLength:4,
			anchor:'40%'
		},
		{
			fieldLabel:'手机号码',
			xtype:'textfield',
			name:'phone',
			maxLength:11,
			anchor:'40%'
		},
		{
			fieldLabel:'邮箱地址',
			xtype:'textfield',
			name:'mail',
			maxLength:255,
			anchor:'40%'
		},
		{
			fieldLabel:'居住地址',
			xtype:'textareafield',
			name:'address',
			maxLength:255,
			anchor:'100%'
		},
		{
			fieldLabel:'证件照片',
			xtype:'textfield',
			hidden:true,
			id:'xt_attachment_id',
			name:'xt_attachment_id',
			maxLength:32,
			anchor:'100%'
		},
		{
			title:'证件照片',
			xtype:'fieldset',
			items:{
				xtype:'box', 
				id:'xt_attachment_id_pic', 
				margin:'2 5 4 70', 
				autoEl:{
					tag:'img',
					/** 不采用右键时候直接用点击事件触发
					onclick:"optupload('xt_attachment_id','xt_attachment_id_pic',1)",
					**/
					src:bsdefimg
				}
			}
		},
		{
			fieldLabel:'创建时间',
			xtype:'datetimefield',
			format:'Y-m-d H:i:s',
			name:'ctime',
			maxLength:19,
			anchor:'40%'
		},
		{
			fieldLabel:'状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态',
			xtype:'numberfield',
			value:'0',
			name:'status',
			maxLength:10,
			anchor:'40%'
		}
		]
	});
}
